
import { Component } from "react";
import DrugAllHeader from "../../components/AllSearch";
import DrugAllMain from "../../components/DrugShowData";
class DrugAll extends Component {
    constructor(props) {
        super(props);
        this.state = { 
            data:null
        }
    }
    getSearchData(data){
        console.log('父组件中的',data);
        this.setState({ data });
    }
    render() {  
        return (<div className='drugAll_box'>
            <DrugAllHeader getSearchData={(data)=>this.getSearchData(data)}/>     
            <DrugAllMain data={this.state.data}/>       
        </div>);
    }
}
 
export default DrugAll;